package com.tiger.cloud.enums;

import com.tiger.cloud.common.mybatis.handler.CodeEnum;

public enum BannerEnum implements CodeEnum<BannerEnum> {
    FIRST(1, "第一张"), SECOND(2, "第二张"),THIRD(3,"第三张"),FOURTH(4,"第四张"),
    FIFTH(5, "第五张"), SIXTH(6, "第六张"),SEVENTH(7,"第七张"),EIGHTH(8,"第八张"),
    NINTH(9, "第九张"), TENTH(10, "第十张"),ELEVENTH(11,"第十一张"),TWELFTH(12,"第十二张");

    private int code;
    private String desc;

    /**
     * 通过枚举<code>name</code>获取枚举
     */
    public static BannerEnum getEnumByCode(Integer code) {
        if(code==null){
            return null;
        }
        for (BannerEnum enumm : BannerEnum.values()) {
            if (enumm.getCode()==code.intValue()) {
                return enumm;
            }
        }
        return null;
    }

    private BannerEnum(int code, String desc) {
        this.code = code;
        this.desc=desc;
    }

    @Override
    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

}
